package com.bps.zzant.controller;

import java.util.List;
import java.util.Locale;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.bps.zzant.model.OrderGarment;
import com.bps.zzant.services.OrderService;

@Controller
public class OrderListController {
	private static final Logger logger = LoggerFactory.getLogger(OrderListController.class);
	
	@Autowired
	private OrderService orderService;

	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}
	
	@RequestMapping(value = "/orderlist", method = RequestMethod.GET)
	public String getOrderList(Locale locale, Model model) {
		logger.info("OrderListController! the client locale is "+ locale.toString());
		List<OrderGarment> orderList = orderService.getOrderList(0, "approved");		
		return "orderlist";
	}
	
}
